import { personColumnWidth } from '../../config';
import { drawHorizontalLines } from './horizontal-lines';

/**
 * 绘制水平网格线
 * @param {object} zr ZRender实例
 * @param {object} chartState 图表状态对象
 * @param {PersonSchedule[]} schedules 人员排班数据
 */
export function drawHorizontalGridLines(zr: any, chartState: ChartState, schedules?: PersonSchedule[]) {
  if (!schedules || schedules.length === 0) {
    return;
  }

  // 水平线应该延伸到整个画布宽度
  const gridEndX = chartState.canvasWidth;

  // 使用统一的水平线绘制组件绘制网格线
  drawHorizontalLines(zr, chartState, schedules, {
    startX: personColumnWidth,
    endX: gridEndX,
    strokeColor: '#e0e0e0',
    lineWidth: 1,
    zIndex: 1,
  });
}
